dreamweaver.getBehaviorElement()

Availability 2.0
Description Gets the DOM object corresponding to the tag to which the behavior is being applied. This function is applicable only in behavior action files.
Arguments None.
Returns A DOM object or null. This function returns null under the following circumstances:
When the current script is not executing within the context of the Behavior inspector.
When the Behavior inspector is being used to edit a behavior in a timeline.
When the currently executing script was invoked by dreamweaver.popupAction().
When the Behavior inspector is attaching an event to a link wrapper and the link wrapper does not yet exist.
When this function appears outside of an action file.
Enabler None.
Example dreamweaver.getBehaviorElement() can be used in the same way as dreamweaver.getBehaviorTag() to determine whether the selected action is appropriate for the selected HTML tag, except that it gives you access to more information about the tag and its attributes. For example, if you write an action that can be applied only to a hyperlink (A HREF) that does not target another frame or window, you can use getBehaviorElement() as part of the function that initializes the user interface for the parameters dialog box.
function initializeUI(){
  var theTag = dreamweaver.getBehaviorElement();
  var CANBEAPPLIED = (theTag.tagName == "A" 
                    && theTag.getAttribute("HREF") != null 
                    && theTag.getAttribute("TARGET") == null);
  if (CANBEAPPLIED) {
    // display the action UI
  } else{
    // display a helpful message that tells the user 
    // that this action can only be applied to a
    // hyperlink without an explicit target]
  }
}